﻿using HCDV;
using HCDV.HCSP;
using hrainwebbase.ashx.spfunction;
//using hcrainMvc.BLL;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Http;

namespace hcrainMvc.Controllers
{
    public class HcrainToolController : ApiController
    {
        /// <summary>
        /// 通用-单一-更新方法
        /// </summary>
        /// <param name="table"></param>
        /// <param name="setinfo"></param>
        /// <param name="whereinfo"></param>
        /// <returns></returns>
        [ActionName("PostHcRainChange")]
        [HttpPost]
        public int PostHcRainChange(postsqlobj obj)
        {
            using (dbsimple db = new dbsimple())
            {
                return db.exe(string.Format("update {0} set {1} where {2}", obj.table, obj.setinfo, obj.whereinfo));
            }
        }
    }
    public class postsqlobj
    {
        public string table { get; set; }
        public string setinfo { get; set; }
        public string whereinfo { get; set; }
    }

}
